package llama.view;

import javax.swing.ImageIcon;

import llama.core.ChatModelLocator;
import llama.core.IChatModel;

public class GUIBuilder {
	private static final String PROGRAM_TITLE = "Llama Chat Client";

	public void setupDefault() {
		ChatFrame chatFrame = new ChatFrame();
		ContactFrame contactFrame = new ContactFrame();
		
		chatFrame.setTitle("Chat Window - "+PROGRAM_TITLE);
		contactFrame.setTitle("Contact List - "+PROGRAM_TITLE);
		
		chatFrame.setIconImage(new ImageIcon("img//llama.png").getImage());	//TODO resource mapping
		contactFrame.setIconImage(new ImageIcon("img//llama.png").getImage());
		
		IChatModel chatModel = ChatModelLocator.getChatModel();
		
		chatModel.addPropertyChangeListener(chatFrame);
		chatModel.addPropertyChangeListener(contactFrame);
		
		chatModel.loadLoginSettings();
	}
	
}
